{% extends 'base.html' %}
{% load adminmedia %}

{% block extra_js %}
    <script type="text/javascript">
window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";
window.onload = (function(){
    $("input[name='operative_repair']").change(function(){
        $('#equip_').toggle();
    });
});
</script>
{% endblock %}
{% block content %}

<form enctype="multipart/form-data" action="" method="post"><div id="csrf_token">{% csrf_token %}</div>
    {{ form.media }}
    <table class="forma color1">
    <tr><td><strong>Фотография:</strong></td><td>{{form.photo}}</td></tr>
    <tr><td><strong>Имя:</strong></td><td {% if form.name.errors %}class="need"{% endif %}>{{form.name}}</td></tr>
    <tr><td><strong>Фамилия:</strong></td><td {% if form.lastname.errors %}class="need"{% endif %}>{{form.lastname}}</td></tr>
    <tr><td><strong>Отчество:</strong></td><td {% if form.patronymic.errors %}class="need"{% endif %}>{{form.patronymic}}</td></tr>
    <tr><td><strong>Табельный номер:</strong></td><td {% if form.tabel_number.errors %}class="need"{% endif %}>{{form.tabel_number}}</td></tr>
    <tr><td><strong>Постоянный номер:</strong></td><td {% if form.permanent_number.errors %}class="need"{% endif %}>{{form.permanent_number}}</td></tr>
    <tr><td><strong>День рождения:</strong></td><td {% if form.birthday.errors %}class="need"{% endif %}>{{form.birthday}}</td></tr>
    <tr><td><strong>Пол:</strong></td><td {% if form.gender.errors %}class="need"{% endif %}>{{form.gender}}</td></tr>
    <tr><td><strong>Привилегия по отпуску:</strong></td><td {% if form.vacation_privilege.errors %}class="need"{% endif %}>{{form.vacation_privilege}}</td></tr>
    <tr><td><strong>Должность:</strong></td><td {% if form.worker_or_rsis.errors %}class="need"{% endif %}>{{form.worker_or_rsis}}</td></tr>
    <tr><td><strong>Оперативный ремонт:</strong></td><td {% if form.operative_repair.errors %}class="need"{% endif %}>{{ form.operative_repair}}</td></tr>
    <tr id="equip_" style="display:none;"><td><strong>Оборудование:</strong></td><td {% if form.equip.errors %}class="need"{% endif %}>{{ form.equip}}</td></tr>
    <tr><td><strong>Профессия:</strong></td><td {% if form.profession.errors %}class="need"{% endif %}>{{form.profession}}</td></tr>
    <tr><td><strong>Подразделение:</strong></td><td {% if form.unit.errors %}class="need"{% endif %}>{{form.unit}}</td></tr>
    <tr><td><strong>Фактическое подразделение:</strong></td><td {% if form.actual_unit.errors %}class="need"{% endif %}>{{form.actual_unit}}</td></tr>
    <tr><td><strong>Пасспорт:</strong></td><td {% if form.passport.errors %}class="need"{% endif %}>{{form.passport}}</td></tr>
    <tr><td><strong>Адрес:</strong></td><td {% if form.address.errors %}class="need"{% endif %}>{{form.address}}</td></tr>
    <tr><td><strong>Квартал:</strong></td><td {% if form.kvartal.errors %}class="need"{% endif %}>{{form.kvartal}}</td></tr>
    <tr><td><strong>Домашний телефон:</strong></td><td {% if form.phone.errors %}class="need"{% endif %}>{{form.phone}}</td></tr>
    <tr><td><strong>Сотовый телефон:</strong></td><td {% if form.mobile_phone.errors %}class="need"{% endif %}>{{form.mobile_phone}}</td></tr>
    </table>
    <input class="baton1" value="Создать" type="submit">
</form>
    <br>

{% endblock %}